d77d6b78de5b042405bc78db866a3c95f20cc7d9,tests/frontend/org/voltdb/regressionsuites/TestFunctionsForJSON.java,TestFunctionsForJSON,testFIELDFunctionWithIndexNotation,#,311
Before Change
// (integer, boolean, float, string), or an object
testProcWithValidJSON(empty_table, client, "IdFieldProc", "id[0]", 1);
testProcWithValidJSON(empty_table, client, "IdFieldProc", "bool[0]", "true");
testProcWithValidJSON(empty_table, client, "IdFieldProc", "numeric[0]", 1.2);
testProcWithValidJSON(empty_table, client, "IdFieldProc", "tag[0]", "one");
testProcWithValidJSON(empty_table, client, "IdFieldProc", "inner[0]", "good for you");
}
After Change
// Verify that index notation returns nothing when used on a primitive
// (integer, float, boolean, string), or an object
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "id[0]");
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "numeric[0]");
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "bool[0]");
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "tag[0]");
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "last[0]");
testProcWithValidJSON(EMPTY_TABLE, client, "NotNullFieldProc", "inner[0]");
// Compare with similar behavior when FIELD is called with ARRAY_ELEMENT
testProcWithValidJSON(FULL_TABLE, client, "NullArrayProc", "id", 0);
testProcWithValidJSON(FULL_TABLE, client, "NullArrayProc", "numeric", 0);
testProcWithValidJSON(FULL_TABLE, client, "NullArrayProc", "bool", 0);
testProcWithValidJSON(FULL_TABLE, client, "NullArrayProc", "last", 0);
testProcWithValidJSON(FULL_TABLE, client, "NullArrayProc", "inner", 0);
testProcWithInvalidJSON("Syntax error: value, object or array expected", client, "NullArrayProc", "tag", 0);
}